﻿namespace Sai.Core
{
	using Sai.Core.Introspection;

	public class AssemblyDifferenceFactory : IAssemblyDifferenceFactory
	{
		private ApplicationVersionStamp avs = new ApplicationVersionStamp();

		public IAssemblyDifference Create(IntrospectedAssembly fromVersion, IntrospectedAssembly toVersion)
		{
			return new AssemblyDifference()
				{
					Name = fromVersion.Name,
					FromVersion = fromVersion.Version.ToString(),
					ToVersion = toVersion.Version.ToString(),
					ProductName = this.avs.Name,
					ProductLink = this.avs.Link,
					ProductVersion = this.avs.Version
				};
		}
	}
}
